﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using TSqlServer;
/// <summary>
/// TAdSetupInfo1 的摘要说明
/// </summary>
public class TAdSetupInfo1:TData
{

    //常量
  	const string CTableName="t_ad_setup_info1";
  	const string CKeyName="typeid";
    //与数据表字段对应的变量
    private string FTypeId ; 
    private string FTypeClass ; 
    private string FTypeName ; 
    private string FDescription ; 
    private string FIsShow ; 
    private decimal FOrderBy ; 
	public TAdSetupInfo1()
	{
		//
		// TODO: 在此处添加构造函数逻辑
		//

        FTableName = CTableName;
        FKeyName = CKeyName;
	}

    public TAdSetupInfo1(string sid)
    {
    	FTableName = CTableName;
        FKeyName = CKeyName;
        FKeyValue = sid;
    }

    public override void Select()
    {
        string strSql = GetSelectString();
        TSqlDB oDB = new TSqlDB(strSql);
        if (!oDB.EOF)
        {

            FTypeId = oDB["typeid"].ToString();
            FTypeClass = oDB["typeclass"].ToString();
            FTypeName = oDB["typename"].ToString();
            FDescription = oDB["description"].ToString();
            FIsShow = oDB["isshow"].ToString();
            FOrderBy = oDB["orderby"].ToDecimal();
        }
        oDB.Free();
    }
    //插入新记录。
    public void Insert()
    {
        string ExSql = "'" + FTypeId + "','" + FTypeClass + "','" + FTypeName + "','" + FDescription + "','" + FIsShow + "','" + FOrderBy + "'";
        base.Insert(ExSql);
    }
    //更新记录。
    public void Update()
    {
        string ExSql= " typeclass ='" + FTypeClass + "', typename ='" + FTypeName + "', description ='" + FDescription + "', isshow ='" + FIsShow + "', orderby ='" + FOrderBy + "'"; 
        base.Update(ExSql);
    }
    //改变状态,0=未验证,1=已通过验证
    public void Update_status()
    {
        string ExSql = "isshow=" + FIsShow.ToString(); ;
        base.Update(ExSql);
    }
    //静态，可以不用创建对象即可调用。
    public static void DeleteByID(string sID)
    {
        TData.DeleteByID(sID, CTableName, CKeyName);
    }


    public string TypeId
    {
        get
        {
            return FTypeId;
        }
        set
        {
            FTypeId = value;
        }
    }
    public string TypeClass
    {
        get
        {
            return FTypeClass;
        }
        set
        {
            FTypeClass = value;
        }
    }
    public string TypeName
    {
        get
        {
            return FTypeName;
        }
        set
        {
            FTypeName = value;
        }
    }
    public string Description
    {
        get
        {
            return FDescription;
        }
        set
        {
            FDescription = value;
        }
    }
    public string IsShow
    {
        get
        {
            return FIsShow;
        }
        set
        {
            FIsShow = value;
        }
    }
    public decimal OrderBy
    {
        get
        {
            return FOrderBy;
        }
        set
        {
            FOrderBy = value;
        }
    }
}
